package com.shortvedio.base.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shortvedio.base.model.po.TaskVedio;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TaskVedioMapper extends BaseMapper<TaskVedio> {

    @Select("SELECT * FROM task_vedio WHERE id % #{shardTotal} = #{shardIndex} AND STATUS = 0")
    List<TaskVedio> selectListByIndex(@Param("shardTotal") int shardTotal, @Param("shardIndex") int shardIndex);//查询为被处理的视频

    @Select("SELECT * FROM task_vedio WHERE DATE_SUB(CURDATE(),INTERVAL 10 DAY) >= DATE(creat_time) AND STATUS = 0 AND id % #{shardTotal} = #{shardIndex}")
    List<TaskVedio> selectListPastDue(@Param("shardTotal") int shardTotal, @Param("shardIndex") int shardIndex);//查询到过期的视频


}
